package liaotian;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Scanner;

public class SendThread implements Runnable{
    private Socket socket;

    public SendThread(Socket socket) {
        this.socket = socket;
    }

    public SendThread() {
    }

    @Override
    public void run() {
        while (true) {

            try {
                Scanner scanner = new Scanner(System.in);
                String s = scanner.nextLine();
                OutputStream os = socket.getOutputStream();
                byte[] bytes = new byte[1024];
                os.write(s.getBytes());

            } catch (IOException e) {
                e.printStackTrace();
            }

        }

    }
}
